﻿using System;
using System.Diagnostics;
using System.Web.UI;
using Speed.Data;

namespace SiteTest.Classes
{

    [DebuggerStepThrough]
    public class PageBase : Page
    {

        private Database db;
        public Database Db
        {
            get
            {
                if (db == null)
                    db = Sys.NewDb();
                return db;
            }
        }

        protected override void OnUnload(EventArgs e)
        {
            base.OnUnload(e);
            if (db != null)
            {
                db.Close();
                db.Dispose();
                db = null;
            }
        }


    }

}